home *** CD-ROM | disk | FTP | other *** search
- /*
- File: LinkedListIterator.h
-
- Contains: stuff
-
- */
-
- #ifndef _LINKEDLISTITERATOR_
- #define _LINKEDLISTITERATOR_
- #pragma once
-
- #include <Types.h>
-
- class ListLink;
- class LinkedList;
-
- //--------------------------------------------------------------------------------
-
- class LinkedListIterator
- {
- protected:
- LinkedList& fList; // The list we're iterating
- ListLink* fCurrentLink; // Link to the current object in list
- LinkedListIterator* fNextIterator; // Link to next iterator of this list
-
- friend class ListLink;
- friend class LinkedList;
-
- public:
- LinkedListIterator(LinkedList& list, ListLink* start = nil);
- ~LinkedListIterator();
-
- ListLink* CurrentLink() { return fCurrentLink; }
-
- virtual Boolean MoreBefore();
- virtual Boolean MoreAfter();
-
- virtual ListLink* FirstLink();
- virtual ListLink* LastLink();
- virtual ListLink* NextLink();
- virtual ListLink* PrevLink();
-
- protected:
- virtual void LinkInserted(ListLink& link); // Called after inserting a lin in list
- virtual void RemovingLink(ListLink& link); // Called before removing a Link from list
- virtual void RemovingAllLinks(void); // Called before clearing the list
-
- };
-
- //--------------------------------------------------------------------------------
-
- #endif // _LINKEDLISTITERATOR_
-
-